# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-net-pcap
_realname=Net-Pcap
pkgver=0.21
pkgrel=2
pkgdesc='Perl/CPAN Module Net::Pcap.'
arch=('x86_64' 'aarch64')
url='https://metacpan.org/release/Net-Pcap'
license=('GPL' 'PerlArtistic')
options=('!emptydirs')
#source=("http://cpan.metacpan.org/authors/id/S/SA/SAPER/$_realname-$pkgver.tar.gz"
source=("https://cpan.metacpan.org/authors/id/C/CO/CORION/$_realname-$pkgver.tar.gz"
        'stubs.inc.patch')
depends=('perl' 'libpcap')
sha512sums=('aab50ac82283b976db6a848b54c5026edd2f1608d2119a8bea7478c1b588a6ca8111691e7b4c0d2d24820fb5036727db9780966ea7270ef82a5e85b2bf612461'
            'd1085b6495e0864bf4cff7a22ed0607f81f87e52a918a5dc54da3a451838a92e904ebd71946b0d2d57cea8b999bfb559c3c85a0601f2da424b406d51f552ebbe')

prepare() {
  cd
  #patch -p1 < stubs.inc.patch
}

build() {
  cd "$_realname-$pkgver"

  PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor

  make
}

package() {
  cd "$_realname-$pkgver"

  make DESTDIR="$pkgdir" install

  find $pkgdir -name perllocal.pod -delete
  find $pkgdir -name .packlist -delete
}

